﻿#ifndef MISSIONEDITVIEW_H
#define MISSIONEDITVIEW_H

#include <QTreeWidget>
#include "hplot.h"
#include "notify.h"

class MissionEditView : public HPlot,public Notify
{
    Q_OBJECT
public:
    explicit MissionEditView(QWidget *parent = 0);
    virtual ~MissionEditView();
    // Notify interface
public:
    void updateTask(const QString &taskObj, const QString &cmdObj, const QString &scriptObj);
    void commandSelect(const QString &cmdObj);
    void updateStyle(const QString &sStyleName);
    virtual void removeTask(const QString& sTaskObj);
signals:
    void sig_selectCommand(const QString& sCommand);

public slots:
    void slot_addItem(QString sID);
    void slot_removeItem(QString sID);


private:
    int getRow(double dTime,bool isEndTime);

    void drawItem(const QString& sID);


protected:
    virtual void mousePressEvent(QMouseEvent* event);


private:
    void clearSelecteState();

private slots:
    void slot_SaveToPNG();
    void slot_SaveToPDF();
    void slot_ResetView();
private:
    double loopTime;// 每行表示的时间范围，默认30秒

};

#endif // MISSIONEDITVIEW_H
